using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UpgradeHeatSink:Upgrade {

	protected override void SubscribeEvents() {
		base.SubscribeEvents();
		MobEventHelper.lateDamage.SubscribeSingle(weapon.owner,Mob_LateDamaging);
	}
	public override void UnsubscribeEvents() {
		base.UnsubscribeEvents();
		MobEventHelper.lateDamage.UnsubscribeSingle(weapon.owner,Mob_LateDamaging);
	}
	void Mob_LateDamaging(object _sender,DamageEventArgs e) {
		if(!weapon.isActiveAndEnabled) return;
		Mob mob = weapon.owner;
		if(!mob.buffs.ContainsKey(typeof(BuffIgnited))||mob.buffs[typeof(BuffIgnited)].stacks>3) return;
		if(e.stat.damageType!=DamageType.OverTime||e.stat.damageElement!=DamageElement.Fire) return;

		e.stat.amount.AddMultiply(0.1f,100);
		mob.buffs[typeof(BuffIgnited)].stacks+=0.125f;

	}

}
